package cn.myschool.test.day4;

import cn.myschool.dao.StudentDao;
import cn.myschool.entity.Student;
import cn.myschool.util.MybatisUtil;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

/**
 * @author oldliu
 * @since 1.0
 */
public class SearchByCols {
    public static void main(String[] args) {
        int []a={1,3,5,7,9,11};
        for(int i:a){
            System.out.println(i);
        }
        SqlSession s = MybatisUtil.get();
        StudentDao mapper = s.getMapper(StudentDao.class);
        List<Student> datas = mapper.searchByColumn(new String[]{"sname","qq","enterdate","sex","telephone"}, "enterdate");
        datas.forEach(x->{
            System.out.println(x);
        });

        MybatisUtil.close(s);
    }
}
